package st.magnuzon.book.client.managed.ui;

import com.google.gwt.requestfactory.ui.client.ProxyRenderer;
import java.util.Set;
import st.magnuzon.book.client.managed.request.AuthorProxy;
import st.magnuzon.book.client.managed.request.TitleProxy;

public class TitleProxyRenderer extends ProxyRenderer<TitleProxy> {

    private static st.magnuzon.book.client.managed.ui.TitleProxyRenderer INSTANCE;

    protected TitleProxyRenderer() {
        super(new String[] { "title" });
    }

    public static st.magnuzon.book.client.managed.ui.TitleProxyRenderer instance() {
        if (INSTANCE == null) {
            INSTANCE = new TitleProxyRenderer();
        }
        return INSTANCE;
    }

    public String render(TitleProxy object) {
        if (object == null) {
            return "";
        }
        return object.getTitle() + " (" + object.getId() + ")";
    }
}
